package com.derbysoft.lowcostadapter.commons.redis.service;

import com.derbysoft.lowcostadapter.commons.redis.service.impl.HSetEntity;
import com.derbysoft.lowcostadapter.commons.redis.service.impl.SetEntity;

import java.util.Collection;
import java.util.List;
import java.util.Map;

public interface JedisClusterService {

    /**
     * ***********************  Query   *******************************
     */

    String get(String key);

    Map<String, RedisSerializable> hGetAll(String key);

    String hGet(String key, String field);

    Collection<String> keys(String pattern);

    /**
     * ***********************  Add * Delete * Modify   *******************************
     */

    void set(RedisSerializable object);

    void hset(RedisSerializable object);

    void removeAll(String key);

    void remove(String key, String field);

    void flushAll();

    void saveHSetEntities(final List<HSetEntity> hSetEntities);

    <E extends RedisSerializable> void pipelined(final List<E> objects);

    void saveSetEntities(List<SetEntity> setEntities);

    boolean hExist(String key, String field);
}
